import request from '@/utils/request'

const baseURL = 'http://localhost:39203/carbon/electricHeat'
// const baseURL = 'http://116.204.103.224:39203/electricHeat'

// 分页条件查询
export function pageList(data) {
  return request({
    url: '/pageList',
    method: 'post',
    data: data,
    baseURL: baseURL
  })
}

// 查询所有存在的年份
export function queryAllYears() {
  return request({
    url: '/years',
    method: 'get',
    baseURL: baseURL
  })
}

// 删除购入电力热力记录
export function deleteElectricHeat(ids) {
  return request({
    url: '/delete',
    method: 'delete',
    data: ids,
    baseURL: baseURL
  })
}

// 添加电力热力购入信息
export function addElectricHeatBuyInfo(addForm) {
  return request({
    url: '/add',
    method: 'post',
    data: addForm,
    baseURL: baseURL
  })
}

// 根据id查询燃料燃烧记录
export function queryFossiFuel(id) {
  return request({
    url: `/query/${id}`,
    method: 'get',
    baseURL: baseURL
  })
}

// 修改电力热力购入信息
export function modifyFossiFuel(data) {
  return request({
    url: '/modify',
    method: 'put',
    data: data,
    baseURL: baseURL
  })
}

// 新增化石燃料
export function addElectricHeat(data) {
  return request({
    url: '/saveNew',
    method: 'post',
    data: data,
    baseURL: baseURL
  })
}
